package com.wang.designpattern.observer;

import java.util.Observable;

public class Client {

    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();

        CurrentConditions currentConditions = new CurrentConditions();
        weatherData.registerObserver(currentConditions);

        BaiduWeather baiduWeather = new BaiduWeather();
        weatherData.registerObserver(baiduWeather);

        System.out.println("通知各个注册的观察者");

        weatherData.setData(10f, 100f, 20.4f);

        weatherData.removeObserver(currentConditions);
        System.out.println("通知各个注册的观察者");

        weatherData.setData(20f, 110f, 23.4f);

    }
}
